package org.ala.tiktools.generator.mybatis.creator.mapper_append;

import org.ala.tiktools.generator.mybatis.config.info.Part;
import org.ala.tiktools.generator.mybatis.creator.dao.DaoInfo;
import org.ala.tiktools.generator.mybatis.creator.entity.EntityInfo;
import org.ala.tiktools.generator.mybatis.dbinfo.TableInfo;
import org.ala.tiktools.generator.mybatis.tools.Tools;

/**
 * @author ala
 * @date 2025-01-02 13:16
 */
public class MapperAppendInfo {

    protected EntityInfo e;
    protected DaoInfo d;

    protected String pkg;
    protected String xmlName;

    public static MapperAppendInfo build(Part p, TableInfo t, EntityInfo e, DaoInfo d) {
        MapperAppendInfo mai = new MapperAppendInfo();
        mai.e = e;
        mai.d = d;
        mai.pkg = p.getOut().getMapper().getPkg();
        mai.xmlName = Tools.upHump(t.getName()) + p.getOut().getMapper().getSuffix() + "Appender";
        return mai;
    }

    public EntityInfo getE() {
        return e;
    }

    public void setE(EntityInfo e) {
        this.e = e;
    }

    public String getPkg() {
        return pkg;
    }

    public void setPkg(String pkg) {
        this.pkg = pkg;
    }

    public String getXmlName() {
        return xmlName;
    }

    public void setXmlName(String xmlName) {
        this.xmlName = xmlName;
    }

    public DaoInfo getD() {
        return d;
    }

    public void setD(DaoInfo d) {
        this.d = d;
    }
}
